#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

class Solution {
public:
    int hammingWeight(uint32_t n) {
        int sum = 0;

        while(n!=0){
            sum = sum+1;
            n&=n-1;
        }

        return sum;
    }
};



